package com.pk.platform.business.privilege.dao.impl;

import java.util.List;
import java.util.Map;

import com.pk.platform.business.core.dao.impl.GenericDaoImpl;
import com.pk.platform.business.privilege.dao.IPrivilegeDao;
import com.pk.platform.domain.privilege.Privilege;

public class PrivilegeDaoImpl extends GenericDaoImpl implements IPrivilegeDao {

	public List<Privilege> queryPrivilegeByIds(String ids)
	{
		String hql = "from Privilege p where id in ( " + ids + " )";
		return this.getHibernateTemplate().find(hql);
	}
	
	public List<Map<String, Object>> queryRoleHasPrivilege(Long roleId)
	{
		String sql = "select privilegeId from p_rolePrivilegeRef where roleId = ?";
		return this.getSjt().queryForList(sql, roleId);
	}
	
	public List<Privilege> querySysPrivilege()
	{
		String hql = "from Privilege p";
		return this.getHibernateTemplate().find(hql);
	}
	
}
